package com.peanutcar.controller;
import com.peanut.common.Result;
import com.peanut.dto.TabSeckillOrderDTO;
import com.peanutcar.service.GasolineService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("seckill")
public class SeckillController {

    private static final Logger logger = LoggerFactory.getLogger(SeckillController.class);

    @Autowired
    private GasolineService gasolineService;

    @GetMapping("getListGasoline")
    @ApiOperation("查询秒杀的订单")
    public Result getListGasoline() {
        try {
            List<TabSeckillOrderDTO> tabGasolineDTO = gasolineService.getListGasoline();
           return  Result.OK().setData(tabGasolineDTO);
        } catch (Exception e) {
            logger.error("查询秒杀表单出错", e);
           return  Result.ERROR();
        }
    }



}
